package test;


import io.PropertiesLoader;
import io.FlatFileDatasetReader;
import tools.GetVectors;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.HashMap;
import java.util.Properties;
import java.util.Set;

public class testGetVector
{
	public static void main(String[] args)
	{
		try
		{
			PropertiesLoader loader=new PropertiesLoader("data\\conf.properties");
			Properties pro=loader.getPropertiesObject();
			String stopWordsFileName=pro.getProperty("stopWordsFileName");
			String tokenDelimiter=pro.getProperty("tokenDelimiter");
			String valueDelimiter=pro.getProperty("valueDelimiter");
			FlatFileDatasetReader fileReader=new FlatFileDatasetReader(stopWordsFileName,tokenDelimiter,valueDelimiter);
			Set <String> stopWordsSet=fileReader.getDataset();
			BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
			String line=null;
			GetVectors.setStopWords(stopWordsSet);
			
			while ((line=reader.readLine())!=null)
			{
				System.out.println(line);
				Map<String, Integer> stat=new HashMap<String, Integer>();
				
				String ret=null;
				String[] eraseMust={"nr","ns"};
				String target="n";
				//stat=GetVectors.generateVector(line,target,eraseMust,1,stat);
				ret =GetVectors.convertVector2String(stat);
				System.out.println(ret);
				
				/*
				stat=GetVectors.eraseStopWords(stat);
				ret =GetVectors.convertVector2String(stat);
				System.out.println(ret);
				
				GetVectors.convertString2Vector(line, ",", "\t");
				*/
				
			}
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
	
}
